<div id="page-wrapper">
        <!-- /.row -->
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-heading"><span class="judul-page">Tambah Master Pegawai</span></div>
                <div class="panel-body">
					<?php 
						echo form_open_multipart('mr_pegawai/add_exe', array('class' => 'form-horizontal', 'role' => 'form')); 
					?>
						<!--
						<div class="form-group">
							<label class="col-sm-2 control-label">NIP</label>
							<div class="col-sm-4">
								<input type="text" name="id_mr_pegawai" class="form-control input-sm" placeholder="NIP">
							</div>
						</div>-->

						<div class="form-group">
							<label class="col-sm-2 control-label">Nama Lengkap</label>
							<div class="col-sm-7">
								<input type="text" name="nm_pegawai" class="form-control input-sm" placeholder="Nama Lengkap">
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label">Tanggal Masuk</label>
							<div class="col-sm-3">
								<input type="text" name="tgl_masuk" class="form-control input-sm tanggal" placeholder="Tanggal Masuk">
							</div>
						</div>
					  
					  <div class="form-group">
              <label class="col-sm-2 control-label">Jenis Kelamin</label>
              <div class="col-sm-9">
                  <label class="radio-inline">
										<input type="radio" name="jk" value="L" checked>
										Laki-laki
									</label>

									<label class="radio-inline">
										<input type="radio" name="jk" value="P">
										Perempuan
									</label>
              </div>
            </div>

						<div class="form-group">
							<label class="col-sm-2 control-label">TTL</label>
							<div class="col-sm-4">
								<input type="text" name="tmp_lahir" class="form-control input-sm" placeholder="Tempat Lahir">
							</div>
							<div class="col-sm-2">
								<input type="text" name="tgl_lahir" class="form-control input-sm tanggal" placeholder="Tanggal Lahir">
							</div>
						</div>
						
						<div class="form-group">
						<label class="col-sm-2 control-label">Ijazah Terakhir</label>
						<div class="col-sm-3">
							<select name="ijazah_akhir" class="form-control input-sm">
								<?php foreach ($list_p->result() as $row_p){ ?>
									<option value="<?php echo $row_p->id_mr_pendidikan; ?>"><?php echo $row_p->pendidikan; ?></option>
								<?php } ?>
							</select>
						</div>
					</div>
		
						
						<div class="form-group">
						<label class="col-sm-2 control-label">Agama</label>
						<div class="col-sm-6">
							<?php 
								$i = 0;
								foreach ($list_a->result() as $row_a){ 
								$i++;
								if($i == 1){
									$checked = "checked";
								}else{
									$checked = "";
								}
								?>
								<label class="radio-inline">
									<input type="radio" name="id_mr_agama" value="<?php echo $row_a->id_mr_agama; ?>" <?php echo $checked; ?>>
									<?php echo $row_a->agama; ?>
								</label>
								<?php 
								} 
							?>
						</div>
					  </div>
						
						<div class="form-group">
							<label class="col-sm-2 control-label">No. Tlp</label>
							<div class="col-sm-4">
							  <input type="text" name="tlp" class="form-control input-sm" placeholder="No. Tlp">
							</div>
						</div>
						
						<div class="form-group">
							<label class="col-sm-2 control-label">Email</label>
							<div class="col-sm-4">
							  <input type="text" name="email" class="form-control input-sm" placeholder="Email">
							</div>
						</div>
					  
						<div class="form-group">
							<label class="col-sm-2 control-label">Alamat</label>
							<div class="col-sm-7">
								<textarea name="alamat" class="form-control input-sm" rows="3" placeholder="Alamat Lengkap"></textarea>
							</div>
						</div>
						
                      <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-9">
                          <button type="submit" onClick="validate()" class="btn btn-primary btn-sm">Simpan</button>
                          <button type="reset" class="btn btn-danger btn-sm">Reset</button>
                        </div>
                      </div>
                    <?php 
						echo form_close();
					?>
                </div>
            </div>
        </div>
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->

<script>
  function validate() {
    $("form").validate({
      rules: {
        nm_pegawai: {
          required: true
        },
        tmp_lahir: {
          required: true
        },
        tgl_lahir: {
          required: true
        },
        tlp: {
          required: true
        },
        email: {
          required: true
        },
        alamat: {
          required: true
        },
      },
      messages: {
        nm_pegawai: {
          required: "Nama Pegawai harus diisi."
        },
        tmp_lahir: {
          required: "Tempat Lahir harus diisi."
        },
        tgl_lahir: {
          required: "Tanggal Lahir harus diisi."
        },
        tlp: {
          required: "Telepon harus diisi."
        },
        email: {
          required: "Email harus diisi."
        },
        alamat: {
          required: "Alamat harus diisi."
        },
      }
    });

    var topicInputs = topics.find("input").attr("disabled", !inital);
  };
</script>